\ProvidesClass{nsfc}
[NSFC正文 \LaTeX 模板]
\def\@classname{nsfc}
\ProcessOptions%
\PassOptionsToPackage{AutoFakeBold=true}{xeCJK}
\PassOptionsToClass{AutoFakeBold=true,scheme=chinese}{ctexart}
\LoadClassWithOptions{ctexart}
% 
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[a4paper,lmargin=30mm,rmargin=30mm,tmargin=25mm,bmargin=25mm]{geometry}
\pagestyle{empty}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage[user]{zref}
\RequirePackage{amsmath}
\RequirePackage{needspace}

\xeCJKsetup{CJKmath=true}
\definecolor{hintblue}{RGB}{0,112,192}
\RequirePackage{fontspec}
\RequirePackage{enumitem}
\setlist[enumerate]{itemsep=0pt}
\setlist[itemize]{itemsep=0pt}

\def\kai{\CJKfamily+{zhkai}}
\newcommand{\hint}[1]{{\kai\color{hintblue}#1}}
\newcommand{\bhint}[1]{{\bf\kai\color{hintblue}#1}}
\ExplSyntaxOn
\__xeCJK_copy_family:nn {CJKmath} {zhkai}
\ExplSyntaxOff
\def\CJKfamilydefault{zhsong}

\newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}\selectfont}  %三号
\newcommand{\xiaosanhao}{\fontsize{15pt}{\baselineskip}\selectfont}  %小三号
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont}%     四号
\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont}  %小四号

%rebuild the reference system
\zref@newprop{nsfcchapter}{（\zhnumber{\the\nsfcchap}）}
\zref@addprops{main}{nsfcchapter}
\zref@newprop{nsfcsection}{\ifnum\the\nsfcsec>0{\the\nsfcsec}\fi\ifnum\the\nsfcsubsec>0{.\the\nsfcsubsec}\fi\ifnum\the\nsfcsubsubsec>0{.\the\nsfcsubsubsec}\fi}
\zref@addprops{main}{nsfcsection}
\newcommand{\nsfclabel}[1]{\zlabel{#1}\label{zref:#1}}

\newcommand{\chapref}[1]{\zref@extract{#1}{nsfcchapter}}
\newcommand{\chaplinkref}[1]{\hyperref[zref:#1]{\zref@extract{#1}{nsfcchapter}}}
\newcommand{\secref}[1]{\hyperref[zref:#1]{\zref@extract{#1}{nsfcsection}}}

\newcount\nsfcchap
\newcount\nsfcsec
\newcount\nsfcsubsec
\newcount\nsfcsubsubsec
\newcommand{\pretitleskip}[1][5]{\Needspace{#1\baselineskip}\vspace{7pt}}
\newcommand{\posttitleskip}{\vspace{4pt}}
\def\maketitle{
    \suppressfloats[t]
    \begin{center}
        {\xiaosanhao\bf\kai\@title}

    \end{center}
    \par {\sihao\kai \@headertext}
    \posttitleskip  
}

\let\section\relax
\let\subsection\relax
\let\subsubsection\relax
\newcommand\chapter[2]{
    

\pretitleskip[10]
\phantomsection
\advance\nsfcchap by1 {\CJKsetecglue{}\color{hintblue}\sihao\kai\textbf{（\zhnumber{\the\nsfcchap}）#1}#2}
\posttitleskip
\nsfcsec=0
\nsfcsubsec=0
\nsfcsubsubsec=0


}
\newcommand\section[2]{


\pretitleskip[8]
\phantomsection
\advance\nsfcsec by1 {\CJKsetecglue{}\color{hintblue}\sihao\kai\the\nsfcsec.\textbf{#1}#2}
\posttitleskip
\nsfcsubsec=0
\nsfcsubsubsec=0


}
\newcommand\subsection[1]{
    

\pretitleskip[6]
\phantomsection
\advance\nsfcsubsec by1
{\CJKsetecglue{}\sihao\kai\the\nsfcsec.\the\nsfcsubsec.\textbf{#1}}
\nsfcsubsubsec=0
\posttitleskip


}

\newcommand\subsubsection[1]{
    

\pretitleskip[4]
\phantomsection
\advance\nsfcsubsubsec by1
{\sihao\kai\textbf{\CJKsetecglue{}\xiaosihao \the\nsfcsec.\the\nsfcsubsec.\the\nsfcsubsubsec.{#1}}}
\posttitleskip


}
\AtBeginDocument{
    \xiaosihao
    \setlength{\baselineskip}{22pt}
}
\RequirePackage[labelformat=simple]{subcaption}
\DeclareCaptionSubType*{figure}
\renewcommand\thesubfigure{\thefigure.\arabic{subfigure}}
\RequirePackage{gbt7714}
\renewcommand{\bibsection}{
    \phantomsection
    \pretitleskip[10]
    \begin{center}
        {\sihao\bf\kaishu 参考文献}
    \end{center}
}

%\citestyle{numbers}
\def\headertext#1{\gdef\@headertext{#1}}
\headertext{{参照以下提纲撰写，要求内容翔实、清晰，层次分明，标题突出。\bhint{请勿删除或改动下述提纲标题及括号中的文字。}}}
\title{报告正文}
\CJKsetecglue{\hskip 0.15em plus 0.05em minus 0.05em}
